<%@page import="com.fasterxml.jackson.annotation.JsonInclude.Include"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html lang="zh-CN">
	<%@ include file="/WEB-INF/include-head.jsp" %>
	<script type="text/javascript">
		$(function () {
			//异步
			$("#asyncBtn").click(function () {
				console.log("ajax之前");
				$.ajax({
					"url":"test/ajax/async.ht",
					"type":"post",
					"dataType":"text",
					"success":function(data){
						console.log("………………ajax之中………………"+data);
					}
					
				});
				console.log("ajax之后");
			});
			//同步
			$("#falseasyncBtn").click(function () {
				console.log("ajax之前");
				$.ajax({
					"url":"test/ajax/async.ht",
					"type":"post",
					"dataType":"text",
					async:false,
					"success":function(data){
						console.log("………………ajax之中………………"+data);
					}
					
				});
				console.log("ajax之后");
			});
		});
	</script>
  <body>
  		<%@ include file="/WEB-INF/include-nav.jsp" %>
    <div class="container-fluid">
			<%@ include file="/WEB-INF/include-sidebar.jsp" %>
			
			
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

			<button id="asyncBtn">发送Ajax请求【异步测试】</button>
			<button id="falseasyncBtn">发送Ajax请求【同步测试】</button>
		</div>

	</div>
  </body>
</html>
